<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        body {
            height: 100vh;
            /* 填充后可删 */
            background-color: #FFCCCC;
        }

        .main {
            position: relative;
            background-color: #CCCCFF;
            width: 400px;
            min-height: 400px;
            /* 填充后可删 */
            top: 100px;
            left: 50%;
            transform: translate(-50%, 0);
            padding: 5px;

            display: grid;
            grid-template-columns: 1fr 20% 30% 3fr;
            grid-template-rows: 1fr 20% 30% 3fr;
        }

        .child {
            text-align: center;
            background-color: #CCFFCC;
            box-sizing: border-box;
            border: 1px solid red;
            /* width: 100px; */
            /* height: 100px; */
        }

        /*粉#FFCCCC 紫#CCCCFF 绿#CCFFCC */
    </style>

</head>

<body>
    <div class="main">
        <div class="child">1fr</div>
        <div class="child">20%</div>
        <div class="child">30%</div>
        <div class="child">3fr</div>
        <div class="child"></div>
        <div class="child"></div>
        <div class="child"></div>
        <div class="child"></div>
        <div class="child"></div>
        <div class="child"></div>
        <div class="child"></div>
        <div class="child"></div>
        <div class="child"></div>
        <div class="child"></div>
        <div class="child"></div>
        <div class="child"></div>
    </div>

</body>

</html>